#pragma once

#include <glm/glm.hpp>
#include <vector>
#include <memory>
#include <string>
#include <stack>

namespace Views
{
	class IView;
	class ViewManager
	{
	public:
		ViewManager(const std::string &resource_dir);
		~ViewManager();

		void update(float dt);
		void render();

		void add(IView *view);
		void pushActive(const std::string &view_id);
		void pushActiveGui(const std::string &view_id);
		void popActive();
		void popActiveGui();

	public:
		void keyInput(int key, int pressed);
		void mouseButtonInput(int button, int pressed);
		void mouseMoveInput(int x, int y);

	private:
		std::string resource_dir;
		std::vector<std::shared_ptr<IView>> views;
		std::stack<IView*> active_view;
		std::stack<IView*> active_gui_view;
	};
}
